<div class="tableToolbar">
    <div class="coll-md-8" id="addInput">
        <div class="coll-md-2">
            <input type="text" class='search' placeholder="用户名" ng-model="ctrlScope.itemsearch.username">
        </div>
        <div class="coll-md-1 scalenone" id="search2">
            <div class="coll-md-10 triangle">
                <select class="form-control" ng-model="ctrlScope.itemsearch.couponStatus">
                    <option selected hidden disabled value="">状态</option>
                    <option value="1">已使用</option>
                    <option value="2">未使用</option>
                    <option value="3">过期</option>
                </select>
            </div>
        </div>
        <div class="coll-md-4 scalenone"  id="searchdate" datahide>
            <div class="coll-md-5" >
                <p class="input-group">
                    <input type="text" class="search" placeholder="添加开始时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="ctrlScope.itemsearch.beginDatex" is-open="popup1.opened" datepicker-options="dateOptions"/>
						<span class="input-group-btn">
							            <button type="button" class="small-icon btn btn-default" ng-click="open1()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							          </span>
                </p>
            </div>
            <div class="coll-md-5">
                <p class="input-group inline">
                    <input type="text" class="search" placeholder="添加结束时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="ctrlScope.itemsearch.endDatex" is-open="popup2.opened" datepicker-options="dateOptions"/>
						<span class="input-group-btn">
							            <button type="button" class="small-icon btn btn-default" ng-click="open2()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							          </span>
                </p>
            </div>
        </div>
        <div class="coll-md-2">
            <input type="button" class="small-icon search2-icon" value="搜索" ng-click="search()">
            <input type="button" class="small-icon search2" value="搜索">
            <input type="button" class="small-icon reset-icon" reset-icon value="重置" ng-click="reset()">
            <input type="button" class="small-icon reset" value="重置">

            <div class="dropdown-menu-right">
                <input type="button" class="small-icon more-icon" value="更多" title='更多搜索项' id="more-icon" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                <input type="button" class="small-icon more" value="更多">
                <ul class="dropdown-menu" style='margin-left:80px;' aria-labelledby="dropdownMenu2" more-search>
                    <li><a href="javascript:;">日期搜索</a></li>
                    <li><a href="javascript:;">状态搜索</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="coll-md-2">
        <input type="button" class="bttn pos-right"  ng-click="addOrderModal()" value="新建">
    </div>
</div>
<table ui-table="orderParams">
    <thead>
    <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>途径</th>
        <th>加息利率</th>
        <th>有效时间</th>
        <th>使用时间</th>
        <th>状态</th>
        <th>使用条件金额</th>
        <th>添加时间</th>
        <th>添加ip</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="item in orderParams.$rows">
        <td>{{item.id}}</td>
        <td>{{item.username}}</td>
        <td>{{item.way}}</td>
        <td>{{item.rate}}</td>
        <td>{{item.expiredTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>{{(item.useTime | date:'yyyy-MM-dd HH:mm:ss') | useTime}}</td>
        <td>{{item.status | couponStatus}}</td>
        <td>{{item.requireAmount}}</td>
        <td>{{item.addtime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>{{item.addip}}</td>
    </tr>
    </tbody>
</table>
<modal title="新建" visible="addModal">
    <form class="form-horizontal" role="form" name="myForm" ng-submit="saveSubmit(myForm.$valid)" novalidate>
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">用户名：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="add.username" required>
                        </div>
                    </div>
                </div>
                <!--<div class="col-md-6">-->
                    <!--<div class="form-group">-->
                        <!--<label class="control-label col-md-4">优惠券类型：</label>-->
                        <!--<div class="col-md-8 triangle-left">-->
                            <!--<select ng-model="add.couponType" class="form-control" required ui-select2="select2Options">-->
                                <!--<option value="" disabled hidden selected >请选择</option>-->
                                <!--<option value="1">红包</option>-->
                                <!--<option value="2">加息券</option>-->
                                <!--<option value="3">代金券</option>-->
                            <!--</select>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <input type="hidden" value='2' ng-model="add.couponType">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">途径：</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="add.way" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">加息利率：</label>

                        <div class="col-md-8 percent">
                            <input type="text" class="form-control" ng-model="add.rate" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">使用条件金额：</label>

                        <div class="col-md-8 yuan">
                            <input type="text" class="form-control" ng-model="add.requireAmount" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">有效时间：</label>
                        <div class="col-md-8">
                            <p class="input-group inline">
                                <input type="text" class="form-control" placeholder="有效时间" uib-datepicker-popup="yyyy-MM-dd"
                                       ng-model="add.expiredTime"  is-open="popup3.opened" datepicker-options="dateOptions"/>
						                <span class="input-group-btn"  required>
							            <button type="button" class="btn btn-default" ng-click="open3()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							            </span>
                            </p>
                        </div>

                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">作用周期：</label>

                        <div class="col-md-8 tian">
                            <input type="text" class="form-control" ng-model="add.usefulLife" required>
                        </div>
                    </div>
                </div>
            </div>
            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue" ng-disabled="myForm.$invalid">保存</button>
            </div>

        </div>
    </form>
</modal>
